import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      //给路径取别名，此处将.src取别名为@
      "@": path.resolve(__dirname, "./src"),
    },
  },
  server: {
    host: "localhost",
    port: 3000,
    //启动服务，自动打开浏览器
    open: true,
    strictPort: false,
    https: false,

    // 代理
    // proxy: {
    //   '/admin': {
    //     	target: 'http://api.vite-admin.com',   //后端提供的接口地址
    //     	changeOrigin: true,					           //允许跨域
    //     	rewrite: (path) => path.replace(/^\/admin/, '')
    //   },
    // }
  },
})